function [out] = CDC2(Rx,fiber_len,fs)

% 补色散，加色散加负长度
% fiber_len : 单位是米


Rx = reshape(Rx,numel(Rx),1);
N=length(Rx);

c=2.998e8;
f=193.1e12;
D=16e-6;
lambda = c/f;

beta2=-D*c/(2*pi*f^2); 


if ceil(N/2)*2==N
    omega=2*pi*fs/N*[(0:N/2-1) (-N/2:-1)];      % freq=-fs/2:fs/N:fs/2-fs/N;
else 
    omega = 2*pi*fs/N*[(0:(N-1)/2) (-(N-1)/2:-1)]; 
end
dispersion=exp(1i*beta2*fiber_len*omega.^2/2); 
dispersion = exp(-(1j*D*lambda^2)/(4*pi*c)*omega.^2*fiber_len);
out = ifft(fft(Rx).*conj(dispersion.'));
